package com.test.indicator;

import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;

/**
 * Created by dws on 2017/12/19.
 */
public class RocketMQHealthIndicator implements HealthIndicator {
    @Override
    public Health health() {
        int errorcode = check();
        if(errorcode!=0){
            return Health.down().withDetail("Error Code",errorcode).build();
        }
        return Health.up().build();
    }

    private int check(){
        //监控对象操作
        return 0;
    }
}
